package cn.xinfei.xdecision.common.dao.datax.datamanage.v2;

import cn.xinfei.xdecision.common.model.datax.datamanage.FieldType;
import cn.xinfei.xdecision.common.model.datax.datamanage.request.FieldTreeParam;
import cn.xinfei.xdecision.common.model.datax.datamanage.v2.VariableTreeParam;
import cn.xinfei.xdecision.common.model.datax.datamanage.v2.VariableType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface VariableTypeMapper extends BaseMapper<VariableType> {


    /**
     * getVariableTypeList:(查找用户的变量类型列表). <br/>
     *
     * @param paramMap 参数集合
     * @return 字段类型列表
     */
    List<VariableType> getVariableTypeList(Map<String, Object> paramMap);

    /**
     * findTypeIdByParentId:(根据传入的变量类型父Code查找子类型Code). <br/>
     *
     * @param paramMap 参数集合
     * @return 子字段类型ID
     */
    String findTypeIdByParentId(Map<String, Object> paramMap);

    /**
     * findParentIdByTypeId:(根据传入的变量类型类型ID查找父ID). <br/>
     *
     * @param paramMap 参数集合
     * @return 子字段类型ID
     */
    String findParentIdByTypeId(Map<String, Object> paramMap);

    /**
     * createFieldType:(新增变量类型). <br/>
     *
     * @param variableType 变量类型实体类
     * @return 插入成功
     */
    boolean createVariableType(VariableType variableType);

    /**
     * findIdByVariableType:(新增变量类型). <br/>
     *
     * @param paramMap paramMap
     * @return 变量类型编号
     */
    long findIdByVariableType(Map<String, Object> paramMap);

    /**
     * updateVariableType:(更新变量类型名). <br/>
     *
     * @param param 参数集合
     * @return 更新成功
     */
    boolean updateVariableType(VariableTreeParam param);

    /**
     * backVariableTypeByTypeIds:(更新变量类型状态为启用状态(1)). <br/>
     *
     * @param paramMap 参数集合
     * @return 更新成功
     */
    boolean backVariableTypeByTypeIds(Map<String, Object> paramMap);

    /**
     * isExists:(查找变量名是否存在). <br/>
     *
     * @param paramMap 参数集合
     * @return 存在的记录条数
     */
    int isExists(Map<String, Object> paramMap);

    List<VariableType> selectVariableTypeList(VariableTreeParam param);

}
